#include <iostream>
#include <algorithm>

int const maxn = 1100;
int a[maxn];
int n, m;

int main()
{
    int T; std::cin >> T;
    while (T--) {
        std::cin >> n >> m;
        for (int i = 0; i < n; i++) {
            std::cin >> a[i];
            a[i] = 100 - a[i];
        }
        std::sort(a, a + n);
        int ans = 0;
        for (int i = 0; i < n && a[i] <= m; i++) {
            ans++; m -= a[i];
        }
        std::cout << ans << '\n';
    }
}

